package com.xpsoft.oa.dao.project.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.project.ProjectExpensesInfoDao;
import com.xpsoft.oa.model.project.ProjectExpensesInfo;

public class ProjectExpensesInfoDaoImpl extends BaseDaoImpl<ProjectExpensesInfo> implements ProjectExpensesInfoDao{

	public ProjectExpensesInfoDaoImpl() {
		super(ProjectExpensesInfo.class);
	}

	@Override
	public void deleteProjectExpensesInfos(Long expensesId, List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from ProjectExpensesInfo where id not in (:ids) and projectExpenses.id=:expensesId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("expensesId", expensesId);
		query.executeUpdate();
	}

}